package club.babyf.nativeai.config;

import club.babyf.nativeai.functioncalling.registry.FunctionRegistry;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Configuration;

/**
 * FunctionCallingInitConfig.
 *
 * @author zhanglei.
 * @date 2025/2/21 15:44.
 * @description 函数回调初始化配置.
 */
@Slf4j
@Configuration
@RequiredArgsConstructor
public class FunctionCallingInitConfig implements InitializingBean {

    private final FunctionRegistry functionRegistry;

    @Override
    public void afterPropertiesSet() throws Exception {
        functionRegistry.scanAndRegister("club.babyf.nativeai.functioncalling.functions");
    }

}
